package com.kc.business.domain;

import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @ClassName BizTeacherRelationship
 * @Description 师承关系表model
 * @Author wangdongliang
 * @Date 2021/5/24 16:21
 */
@Data
@Table(name = "kc_teacher_relationship")
public class BizTeacherRelationship {
    @Id
    /*id*/
    private Integer id;
    /*名称*/
    @NotEmpty(message = "名称不能为空")
    private String name;
    /*上级id*/
    @NotNull(message = "上级id不能为空")
    @Min(value = 0,message = "上级id错误")
    private Integer pid;
//    @NotEmpty(message = "关系id不能为空")
//    private String relation;
    /*状态*/
    @NotNull(message = "状态不能为空")
    @Min(value = 0,message = "状态值错误")
    @Max(value = 1,message = "状态值错误")
    private Integer status;
    /*是否删除:1已删除，0未删除*/
    private Integer isDeleted = 0;
    /*创建时间*/
    private LocalDateTime createTime;
    /*最后修改时间*/
    private LocalDateTime updateTime;
    @Transient
    private List<BizTeacherRelationship> childred;

}
